<html>
    <head>

    </head>
    <body>




        <script>
            // let a = function run(){
            //     console.log('fadf');
            // }

            // let b ={
            //     var1:'dagdf',
            //     myMethod:function my(){

            //     }
            // }
            // let c = Object.create(null,{
            //     var1:{
            //         value:'eqtgrg',
            //         writable:'false'
            //     },
            //     myMethod:{
            //         value:function(){

            //         },
            //         name:'my',
            //     }
            // })


            class MyClass{
                static a = 10;
                static #b = 11;
                c = 12;
                #d = 13;

                intro(){
                    console.log(MyClass.a);
                    console.log(MyClass.#b);
                    console.log(this.c);
                    console.log(this.#d);
                }
            }

            let o1 = new MyClass();
            o1.intro();         //通过成员方法，便可以访问私有类变量、私有成员变量

            console.log(MyClass.a);
            //console.log(MyClass.#b);  //报错，在类的外部无法访问
            console.log(o1.c);
            //console.log(o1.#d);     //报错，在类的外部无法访问



            let str = `
            print 'WORKER_THREADS-----'||sf_get_para_value(1,'WORKER_THREADS');
            print 'TASK_THREADS-----'||sf_get_para_value(1,'TASK_THREADS');
            print 'IO_THR_GROUPS-----'||sf_get_para_value(1,'IO_THR_GROUPS');
            print 'MAX_OS_MEMORY-----'||sf_get_para_value(1,'MAX_OS_MEMORY');
            print 'MEMORY_POOL-----'||sf_get_para_value(1,'MEMORY_POOL');
            print 'MEMORY_N_POOLS-----'||sf_get_para_value(1,'MEMORY_N_POOLS');
            print 'MEMORY_TARGET-----'||sf_get_para_value(1,'MEMORY_TARGET');
            print 'BUFFER-----'||sf_get_para_value(1,'BUFFER');
            print 'BUFFER_POOLS-----'||sf_get_para_value(1,'BUFFER_POOLS');
            print 'RECYCLE-----'||sf_get_para_value(1,'RECYCLE');
            print 'RECYCLE_POOLS-----'||sf_get_para_value(1,'RECYCLE_POOLS');
            print 'HJ_BUF_GLOBAL_SIZE-----'||sf_get_para_value(1,'HJ_BUF_GLOBAL_SIZE');
            print 'HJ_BUF_SIZE-----'||sf_get_para_value(1,'HJ_BUF_SIZE');
            print 'HAGR_BUF_GLOBAL_SIZE-----'||sf_get_para_value(1,'HAGR_BUF_GLOBAL_SIZE');
            print 'SORT_FLAG-----'||sf_get_para_value(1,'SORT_FLAG');
            print 'SORT_BLK_SIZE-----'||sf_get_para_value(1,'SORT_BLK_SIZE');
            print 'SORT_BUF_SIZE-----'||sf_get_para_value(1,'SORT_BUF_SIZE');
            print 'SORT_BUF_GLOBAL_SIZE-----'||sf_get_para_value(1,'SORT_BUF_GLOBAL_SIZE');
            print 'RLOG_POOL_SIZE-----'||sf_get_para_value(1,'RLOG_POOL_SIZE');
            print 'SESS_POOL_SIZE-----'||sf_get_para_value(1,'SESS_POOL_SIZE');
            print 'CACHE_POOL_SIZE-----'||sf_get_para_value(1,'CACHE_POOL_SIZE');
            print 'DICT_BUF_SIZE-----'||sf_get_para_value(1,'DICT_BUF_SIZE');

            print 'VM_POOL_TARGET-----'||sf_get_para_value(1,'VM_POOL_TARGET');
            print 'SESS_POOL_TARGET-----'||sf_get_para_value(1,'SESS_POOL_TARGET');
            print 'USE_PLN_POOL-----'||sf_get_para_value(1,'USE_PLN_POOL');
            print 'ENABLE_MONITOR-----'||sf_get_para_value(1,'ENABLE_MONITOR');
            print 'SVR_LOG-----'||sf_get_para_value(1,'SVR_LOG');
            print 'TEMP_SIZE-----'||sf_get_para_value(1,'TEMP_SIZE');
            print 'TEMP_SPACE_LIMIT-----'||sf_get_para_value(1,'TEMP_SPACE_LIMIT');
            print 'MAX_SESSIONS-----'||sf_get_para_value(1,'MAX_SESSIONS');
            print 'MAX_SESSION_STATEMENT-----'||sf_get_para_value(1,'MAX_SESSION_STATEMENT');
            print 'PK_WITH_CLUSTER-----'||sf_get_para_value(1,'PK_WITH_CLUSTER');
            print 'ENABLE_ENCRYPT-----'||sf_get_para_value(1,'ENABLE_ENCRYPT');
            print 'OLAP_FLAG-----'||sf_get_para_value(1,'OLAP_FLAG');
            
            print 'VIEW_PULLUP_FLAG-----'||sf_get_para_value(1,'VIEW_PULLUP_FLAG');
            print 'OPTIMIZER_MODE-----'||sf_get_para_value(1,'OPTIMIZER_MODE');
            print 'ADAPTIVE_NPLN_FLAG-----'||sf_get_para_value(1,'ADAPTIVE_NPLN_FLAG');
            print 'TOP_DIS_HASH_FLAG-----'||sf_get_para_value(1,'TOP_DIS_HASH_FLAG');
            print 'TOP_ORDER_OPT_FLAG-----'||sf_get_para_value(1,'TOP_ORDER_OPT_FLAG');
            `;
            let str1 = str.match(/print '(?<mingzi>.*)-----'/g);
            //let str2 = str.exec(/print '(.*)-----'/);
        
            console.log(str1);
            console.log(str1[0]);
            console.log(str1[1]);
            console.log(str1[2]);

            console.log(str1[0].substring(7,str1[0].indexOf('-')));
            console.log('-------------')
            for(i=0;i<39;i++){
                let myVar = str1[i].substring(7,str1[i].indexOf('-'));
                //a0 varchar := 'WORKER_THREADS';
                //console.log('a'+i+' varchar := '''+myVar+''';');
                console.log(`a${i} varchar := '${myVar}';`);
            }
     


                // let reg = /print '(?<mingzi>.*)-----'/g;
                // str.indexOf(r);
                // let result = reg.exec(str);
                // console.log(result);
                // console.log(result[0]);
                // console.log(result[1]);

            let str11 = `
                        a0  varchar := 'WORKER_THREADS';
                        a1  varchar := 'TASK_THREADS';
                        a2  varchar := 'IO_THR_GROUPS';
                        a3  varchar := 'MAX_OS_MEMORY';
                        a4  varchar := 'MEMORY_POOL';
                        a5  varchar := 'MEMORY_N_POOLS';
                        a6  varchar := 'MEMORY_TARGET';
                        a7  varchar := 'BUFFER';
                        a8  varchar := 'BUFFER_POOLS';
                        a9  varchar := 'RECYCLE';
                        a10 varchar := 'RECYCLE_POOLS';
                        a11 varchar := 'HJ_BUF_GLOBAL_SIZE';
                        a12 varchar := 'HJ_BUF_SIZE';
                        a13 varchar := 'HAGR_BUF_GLOBAL_SIZE';
                        a14 varchar := 'SORT_FLAG';
                        a15 varchar := 'SORT_BLK_SIZE';
                        a16 varchar := 'SORT_BUF_SIZE';
                        a17 varchar := 'SORT_BUF_GLOBAL_SIZE';
                        a18 varchar := 'RLOG_POOL_SIZE';
                        a19 varchar := 'SESS_POOL_SIZE';
                        a20 varchar := 'CACHE_POOL_SIZE';
                        a21 varchar := 'DICT_BUF_SIZE';
                        a22 varchar := 'VM_POOL_TARGET';
                        a23 varchar := 'SESS_POOL_TARGET';
                        a24 varchar := 'USE_PLN_POOL';
                        a25 varchar := 'ENABLE_MONITOR';
                        a26 varchar := 'SVR_LOG';
                        a27 varchar := 'TEMP_SIZE';
                        a28 varchar := 'TEMP_SPACE_LIMIT';
                        a29 varchar := 'MAX_SESSIONS';
                        a30 varchar := 'MAX_SESSION_STATEMENT';
                        a31 varchar := 'PK_WITH_CLUSTER';
                        a32 varchar := 'ENABLE_ENCRYPT';
                        a33 varchar := 'OLAP_FLAG';
                        a34 varchar := 'VIEW_PULLUP_FLAG';
                        a35 varchar := 'OPTIMIZER_MODE';
                        a36 varchar := 'ADAPTIVE_NPLN_FLAG';
                        a37 varchar := 'TOP_DIS_HASH_FLAG';
                        a38 varchar := 'TOP_ORDER_OPT_FLAG';
                        `;
            let str12 = str11.match(/:= (?<par>.*);/g);
            for (let i = 0; i < str12.length; i++) {
                console.log(str12[i].substring(3,str12[i].indexOf(';')));
                
            }
            
        </script>
    </body>
</html>